package com.tiemei.demo.beanutils;

/**
 * 扩展功能
 *
 * @author tiemei
 * @date   2013-1-30
 */
public class ExBeanProperty {
	/*
	 * 	这是一个树型的Bean属性视图
Book book
|--List authors
      |--[0]->Person person
                    |--Map favorites
                             |--Entry(key->"food",value->"")
PropertyUtils.setProperty(book,"authors[0].favorites(food)","rice");
String favorFood=(String)PropertyUtils.getProperty(book,"authors[0].favorites(food)");->rice

	 */
	
	
	
	/*
	 * 是否可读（有getter）或可写（有setter）

PropertyUtils.isReadable(book,"name");
PropertyUtils.isWritable(book,"name");

	 */
	
	
	/*
	 *copyProperty()复制Bean属性,只复制引用，final类型和原始类型（primitive type）
Book book1=new Book();
book1.setName("Commons Cookbook Notes");
Book book2=new Book();
PropertyUtils.copyProperty(book2,book1);//将book1的name属性copy到book2
 
	 */
	
	
	/*
	 * describe()创建包含Bean属性的Map
Person person=new Person();
person.setName("heis");
Book book=new Book();
book.setName("Commons Cookbook Notes");
book.setAuthor(person);

Map propMap=PropertyUtils.describe(book);
propMap.get("name");->Commons Cookbook Notes
propMap.get("author");->person

	 */
	
	
	
}
